<script setup>
import {onMounted, ref} from "vue";
import {useScoreStore} from "@/store/userStore.js";

const emit = defineEmits(['searchUser']);
const props = defineProps({
  type: String,
})
onMounted(() => {
  useScoreStore().type = props.type == '' ? '学号' : props.type
})
</script>

<template>
  <div class="join">
    <select class="select select-ghost" v-model="useScoreStore().type" v-if="props.type ==''">
      <option selected>学号</option>
      <option>姓名</option>
      <option>班级</option>
      <option>课程</option>
      <option>教师</option>
    </select>
    <input class="input join-item" :placeholder="'输入'+useScoreStore().type" v-model="useScoreStore().msg"/>
    <button class="btn join-item rounded-r-full" @click="useScoreStore().updateScores(1, 7)">
      查询
    </button>
  </div>
</template>

<style scoped>

</style>